package com.jltx.xq.appexitpro;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivityD extends BaseAppCompatActivity {

    private TextView tv;
    private Button nextBtn;
    private Button exitBtn;
    private Button exitBtn1;
    private Button exitBtn2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_d);

        tv = (TextView)findViewById(R.id.text);
        tv.setText(tv.getText().toString()+":"+this.toString());
        nextBtn = (Button)findViewById(R.id.next_btn);
        exitBtn = (Button)findViewById(R.id.exit_btn);
        exitBtn1 = (Button)findViewById(R.id.exit_btn1);
        exitBtn2 = (Button)findViewById(R.id.exit_btn2);
        if(nextBtn != null){
            nextBtn.setOnClickListener(onClickListener);
        }
        exitBtn.setOnClickListener(onClickListener);
        exitBtn1.setOnClickListener(onClickListener);
        exitBtn2.setOnClickListener(onClickListener);
    }



    private View.OnClickListener onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            switch (v.getId()){
                case R.id.exit_btn:
                    android.os.Process.killProcess(android.os.Process.myPid());
//                    String str = null;
//                    str.toString();
                    break;
                case R.id.exit_btn1:
                    App.getApp().exitApp();
                    break;
                case R.id.exit_btn2:
                    App.getApp().exitApp1(MainActivityD.this);
                    break;
                default:
                    break;
            }
        }
    };
}
